<template>
  <div class="student">
    <h2>学生姓名:{{name}}</h2>
    <h2>学生年龄:{{age}}</h2>
    <button @click="showMore">点击展示更多信息</button>
  </div>
</template>

<script>
  export default {
    name:'Student',
    data(){
      return {
        name:'陈嘉玲',
        age:40,
        gender:'女',
        home:'台南'
      }
    },
    methods: {
      showMore(){
        return alert(`性别: ${this.gender} ; 家乡: ${this.home}`)
      }
    },
  }
</script>

<style scoped>
  .student{
    background-color: rgb(91, 94, 236);
    padding: 20px;
  }
</style>